// index.js
// 获取应用实例
const app = getApp()
const { anonymousLogin } = require('../../utils/request');
Page({
  data: {},

  onLoad() {
    var value = wx.getStorageSync('token')
    console.log('token',value)
    if (value.length == 0) {
      // 未匿名登录，进行匿名登录
      anonymousLogin().then(() => {
        wx.redirectTo({
          url: '/pages/cashService/roleSelection/roleSelection',
        })
      })
    } else {
      // 已匿名登录
      wx.redirectTo({
        url: '/pages/cashService/roleSelection/roleSelection',
      })
    }
  },
})
